<div class="container">
  <h1>get_one_where()</h1>
  <p class="signature">public function get_one_where(string $column, $value, ?string $target_table = null): object|false</p>
  <h2>Description</h2>
  <div class="description">
    <p>
      Fetches a single record based on a column value from a database table. This method constructs and executes an SQL query to retrieve the record where the specified column matches the provided value from the specified table. If no record is found, it returns false.
    </p>
  </div>
  <h2>Parameters</h2>
  <table>
    <thead>
      <tr>
        <th>Parameter</th>
        <th>Type</th>
        <th>Description</th>
        <th>Default</th>
        <th>Required</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>column</td>
        <td>string</td>
        <td>The name of the column to filter by.</td>
        <td>N/A</td>
        <td>Yes</td>
      </tr>
      <tr>
        <td>value</td>
        <td>mixed</td>
        <td>The value to match against the specified column.</td>
        <td>N/A</td>
        <td>Yes</td>
      </tr>
      <tr>
        <td>target_table</td>
        <td>string|null</td>
        <td>(optional) The name of the database table to be queried. When a table name is not explicitly passed into the method, the table name will be assumed to be the value of the first URL segment.</td>
        <td>'First URL segment'</td>
        <td>No</td>
      </tr>
    </tbody>
  </table>
  <h2>Return Value</h2>
  <table>
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>object|false</td>
        <td>An object representing the fetched record, or false if no record is found.</td>
      </tr>
    </tbody>
  </table>
  <h2>Exceptions</h2>
  <table>
    <thead>
      <tr>
        <th>Exception Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>RuntimeException</td>
        <td>Thrown if the query execution fails.</td>
      </tr>
    </tbody>
  </table>
  <h2>Example Usage #1</h2>
  <p>The code sample below demonstrates how to fetch a single record from the 'users' table where the 'username' column matches the value 'john_doe'.</p>
  <div class="example">
    <pre>
$user_obj = $this->model->get_one_where('username', 'john_doe', 'users');</pre>
  </div>

  <h2>Example Usage #2</h2>
  <p>In this alternative example, no table name has been passed into the method. This means that the table name will be assumed to be the value of the first URL segment.</p>
  <div class="example">
    <pre>
$record_obj = $this->model->get_one_where('id', 123);</pre>
  </div>
</div>